Azure, Uncategorized

How to deploy a Web Application to Azure using Powershell

I have been using this ps script to deploy a webapp/ webapi to Azure using Powershell. It has minimal configuration but the commands allow you to define everything from Resource Group to scaling options for that matter if there is a need.

  1. PS D:\Deploy> $WebSiteLoc=”East US”
  2. PS D:\Deploy> $WebSiteName = “PowershellTrialSaurabh”
  3. PS D:\Deploy> Test-AzureName -Website $WebSiteName
    False
  4. PS D:\Deploy> New-AzureWebsite -Location $WebSiteLoc -Name $WebSiteName

Instances : {}
NumberOfWorkers : 1
DefaultDocuments : {Default.htm, Default.html, Default.asp, index.htm…}
NetFrameworkVersion : v4.0
PhpVersion : 5.4
RequestTracingEnabled : False
HttpLoggingEnabled : False
DetailedErrorLoggingEnabled : False
PublishingUsername : $PowershellTrialSaurabh
PublishingPassword : EFWilNQrGDMoeYh1oemrku0NSn47h2P8SiPgPDaulebANQzlefzz0qFLTppQ
AppSettings : {WEBSITE_NODE_DEFAULT_VERSION}
Metadata : {}
ConnectionStrings : {}
HandlerMappings : {}
Name : PowershellTrialSaurabh
State : Running
HostNames : {powershelltrialsaurabh.azurewebsites.net}
WebSpace : saurabhfirstmvcsample-RG-EastUSwebspace
SelfLink : https://waws-prod-blu-053.api.azurewebsites.windows.net:454/subscriptions/a866dc2f-b0
ec-4247-80d2-80a365738118/webspaces/saurabhfirstmvcsample-RG-EastUSwebspace/sites/Pow
ershellTrialSaurabh
RepositorySiteName : PowershellTrialSaurabh
Sku : Free
UsageState : Normal
Enabled : True
AdminEnabled : True
EnabledHostNames : {powershelltrialsaurabh.azurewebsites.net,
powershelltrialsaurabh.scm.azurewebsites.net}
SiteProperties : Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities.SitePropertie
s
AvailabilityState : Normal
HostNameSslStates : {powershelltrialsaurabh.azurewebsites.net,
powershelltrialsaurabh.scm.azurewebsites.net}
AzureDriveTraceEnabled :
AzureDriveTraceLevel : Error
AzureTableTraceEnabled :
AzureTableTraceLevel : Error
AzureBlobTraceEnabled :
AzureBlobTraceLevel : Error
ManagedPipelineMode : Integrated
WebSocketsEnabled : False
RemoteDebuggingEnabled : False
RemoteDebuggingVersion :
RoutingRules : {}
Use32BitWorkerProcess : True
AutoSwapSlotName :
SlotStickyAppSettingNames : {}
SlotStickyConnectionStringNames : {}

6. PS D:\Deploy> Show-AzureWebsite $WebSiteName
7. PS D:\Deploy> $path = “D:\Deploy\sampleazureapp.zip”
8. PS D:\Deploy> Publish-AzureWebsiteProject -Name $WebSiteName -Package $path
Change Summary:
Bytes Copied: 23380708
Files Added: 108
Files Updated: 4
Files Deleted: 1
Errors: 0
Warnings: 0
Parameters Changed: 0
Total No of Changes: 113

Standard

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s