Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Configuring Azure Services and emulators using Visual Studio

#1
Configuring Azure Services and emulators using Visual Studio

<div style="margin: 5px 5% 10px 5%;"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/05/configuring-azure-services-and-emulators-using-visual-studio.jpg" width="150" height="150" title="" alt="" /></div><div><div class="row justify-content-center">
<div class="col-md-4">
<div><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/05/configuring-azure-services-and-emulators-using-visual-studio.jpg" width="58" height="58" alt="Angelos Petropoulos" class="avatar avatar-58 wp-user-avatar wp-user-avatar-58 alignnone photo"></p>
<p>Angelos</p>
</div>
</div>
</div>
<div class="entry-meta">
<p>May 6th, 2020</p>
</p></div>
<p><!-- .entry-meta --> </p>
<p>Starting with Visual Studio 16.6 Preview 2 the Connected Services tab offers a new experience called <strong>Service Dependencies</strong>. You can use it to connect your app to Azure services such as Azure SQL, Storage, Key Vault and many others. Wherever possible local emulation options are also available and more are planned for the future.</p>
<p><a href="https://www.sickgaming.net/blog/wp-content/uploads/2020/05/configuring-azure-services-and-emulators-using-visual-studio.png"> <img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/05/configuring-azure-services-and-emulators-using-visual-studio.png" alt="Connected Services tab - Service Dependencies table" width="843" height="259" class="alignnone size-full wp-image-23582"></a></p>
<h3>Add a new Service Dependency</h3>
<p>You can easily and quickly get the right NuGet packages, start-up code and configuration added to your project for every supported Azure service. You simply click add, pick the service from the list and follow the 2-3 steps in the wizard. Here is an example of adding Azure Cosmos DB</p>
<p><a href="https://www.sickgaming.net/blog/wp-content/uploads/2020/05/configuring-azure-services-and-emulators-using-visual-studio.gif"> <img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/05/configuring-azure-services-and-emulators-using-visual-studio.gif" alt="Connected Services tab - Add Azure CosmosDB" width="800" height="520" class="alignnone size-full wp-image-23584"></a></p>
<h3>Provision a new instance of an Azure service without leaving the IDE</h3>
<p>In the above example we re-used an existing instance of Azure Cosmos DB, but you can also create new instances of all the supported Azure services without leaving the IDE. Here is Azure Cosmos DB again as an example of provisioning Azure resources from within Visual Studio</p>
<p><a href="https://www.sickgaming.net/blog/wp-content/uploads/2020/05/configuring-azure-services-and-emulators-using-visual-studio-1.png"> <img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/05/configuring-azure-services-and-emulators-using-visual-studio-1.png" alt="Connected Services tab - Create Azure Cosmos DB Instance" width="547" height="600" class="alignnone size-full wp-image-23586"></a></p>
<h3>Configure service dependencies for remote environments</h3>
<p>Using Visual Studio to publish your app to Azure App Service gives you the opportunity to configure these dependencies for the remote environment you are publishing to. Right click &gt; Publish on your project in Solution Explorer and go through the wizard to create a new publish profile for Azure App Service. At the end you will see a <strong>Service Dependencies</strong> list already containing all of your application’s dependencies ready to be configured for this remote environment</p>
<p><a href="https://www.sickgaming.net/blog/wp-content/uploads/2020/05/configuring-azure-services-and-emulators-using-visual-studio-2.png"> <img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/05/configuring-azure-services-and-emulators-using-visual-studio-2.png" alt="Publish - Unconfigured Service Dependencies" width="1078" height="685" class="alignnone size-full wp-image-23593"></a></p>
<h3>How it works under the covers</h3>
<p>To support all of this Visual Studio creates two new files visible in Solution Explorer under <strong>Properties</strong> called <strong>serviceDependencies.json</strong> and <strong>serviceDependencies.local.json</strong>. Both of these files are safe to check in as they do not contain any secrets.</p>
<p><a href="https://www.sickgaming.net/blog/wp-content/uploads/2020/05/configuring-azure-services-and-emulators-using-visual-studio-3.png"> <img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/05/configuring-azure-services-and-emulators-using-visual-studio-3.png" alt="serviceDependencies.json file" width="1078" height="380" class="alignnone size-full wp-image-23595"></a></p>
<p>Visual Studio also creates a file called <strong>serviceDependencies.local.json.user</strong> which is not visible in Solution Explorer by default. This file contains information that could be considered a secret (e.g. resource IDs in Azure) and we do not recommend you check it in.</p>
<h3>Service References</h3>
<p>While working on the Connected Services tab we took the opportunity to consolidate our UX and make it the new home for the existing OpenAPI &amp; gRPC Service References table. With everything being in one place now we have routed the Right Click &gt; Add &gt; Service Reference… context menu item in Solution Explorer to the consolidated Connected Services tab.</p>
<p><a href="https://www.sickgaming.net/blog/wp-content/uploads/2020/05/configuring-azure-services-and-emulators-using-visual-studio-4.png"> <img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/05/configuring-azure-services-and-emulators-using-visual-studio-4.png" alt="Connected Services Tab - Service References" width="950" height="654" class="alignnone size-full wp-image-23606"></a></p>
<h3>Feedback</h3>
<p>Please give all of the above a try and let us know what you think. Do you wish we supported a feature or Azure service that we don’t already? Please let us know! You can submit a <a href="https://developercommunity.visualstudio.com/content/idea/post.html?space=8" rel="noopener noreferrer" target="_blank">new feature suggestion</a>, leave us comments on this post and report any issues you may encounter using the <a href="https://docs.microsoft.com/en-us/visualstudio/ide/how-to-report-a-problem-with-visual-studio?view=vs-2019" rel="noopener noreferrer" target="_blank">built-in tools</a>.</p>
</div>


https://www.sickgaming.net/blog/2020/05/...al-studio/
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum software by © MyBB Theme © iAndrew 2016