I would like to know how to publish my Web API to an Azure Deployment Slot in VS 4 Mac.
It's straightforward to select the deployment slot I want to deploy in VS 4 Windows; I don't see that option in VS 4 Mac.
How can I achieve this in Mac OS?
I would like to know how to publish my Web API to an Azure Deployment Slot in VS 4 Mac.
It's straightforward to select the deployment slot I want to deploy in VS 4 Windows; I don't see that option in VS 4 Mac.
How can I achieve this in Mac OS?
It can't be done from the VS Mac GUI, but you can create a publishing profile in Properties --> Publish Profile folder of your project, and enter the details manually by referring the publish profile from Azure portal.
If you want to deploy an AzureWebSite to a slot, first save the following template as an .xml file in /YOUR/SOLUTION/PROJECT/Properties/PublishProfiles/YOURPROJECT-ENV_SLOTNAME.pubxml. The values in {}
's will need to be populated.
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>ZipDeploy</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<ResourceId>/subscriptions/{SUBSCRIPTION_ID}/resourceGroups/{RESOURCE_GROUP}/providers/Microsoft.Web/sites/{YOURPROJECT}</ResourceId>
<ResourceGroup>{RESOURCE_GROUP}</ResourceGroup>
<PublishProvider>AzureWebSite</PublishProvider>
<PublishUrl>{PUBLISH_URL}</PublishUrl>
<SiteUrlToLaunchAfterPublish>{DESTINATION_URL}</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<UserName>{USERNAME}</UserName>
<Password>{PASSWORD}</Password>
</PropertyGroup>
</Project>
{RESOURCE_GROUP}
and {SUBSCRIPTION_ID}
are both found in the Azure Portal. Note: the resource group value is not the one listed on the overview screen for a resource. That one will likely be all lowercase. Currently, you can get the resource group name by:
Name
column to populate {RESOURCE_GROUP}
(may have some upper case characters).While on the resource group screen, there should be a Subscription ID
value given at the top for the resource. Populate {SUBSCRIPTION_ID}
with this GUID/UUID value.
Next download the publish profile
for your slot. The current instructions are:
The remaining values will come from the downloaded publish profile. Open the downloaded publish profile file in a text editor and you will find:
<publishData>
<publishProfile ...>
<databases />
</publishProfile>
<publishProfile ...>
<databases />
</publishProfile>
<publishProfile
profileName="{YOURPROJECT} - Zip Deploy"
publishMethod="ZipDeploy"
publishUrl="{PUBLISH_URL}"
userName="{USERNAME}"
userPWD="{PASSWORD}"
destinationAppUrl="{DESTINATION_URL}"
SQLServerDBConnectionString="" mySQLDBConnectionString="" hostingProviderForumLink=""
controlPanelLink="http://windows.azure.com" webSystem="WebSites">
<databases />
</publishProfile>
<publishProfile ...>
<databases />
</publishProfile>
</publishData>
Match up the values from the {}
's with the values in the template.
Now when you right click on the project your slot should be listed as a publishing option.