@zhouyy
2018-03-16T06:55:54.000000Z
字数 5712
阅读 630
azure
location name
PS C:\Users\Administrator.USER-20170626GN> Add-AzureAccount -Environment AzureChinaCloudId Type Subscriptions Tenants-- ---- ------------- -------zyjy@SHXH.partner.onmschina.cn User 5e58c83f-1967-4f91-8fbd-dea4f66305cd {113aef27-55c0-4536-9576-bd8c6a7846d3}PS C:\Users\Administrator.USER-20170626GN> Get-AzureWebsiteLocationChina NorthChina EastPS C:\Users\Administrator.USER-20170626GN> Test-AzureName -Website "yy-test-web"FalsePS C:\Users\Administrator.USER-20170626GN> $wsLocation="China North"PS C:\Users\Administrator.USER-20170626GN> $wsName="yy-test-web"PS C:\Users\Administrator.USER-20170626GN> New-AzureWebsite -Location $wsLocation -Name $wsNameInstances : {}NumberOfWorkers : 1DefaultDocuments : {Default.htm, Default.html, Default.asp, index.htm...}NetFrameworkVersion : v4.0PhpVersion : 5.6RequestTracingEnabled : FalseHttpLoggingEnabled : FalseDetailedErrorLoggingEnabled : FalsePublishingUsername : $yy-test-webPublishingPassword : m9uhEjPqTiAXMuRbNwbgSN2243EQ2uhbhMWhhEcAid2sqQcubfasK3z9nSKTAppSettings : {WEBSITE_NODE_DEFAULT_VERSION}Metadata : {}ConnectionStrings : {}HandlerMappings : {}Name : yy-test-webState : RunningHostNames : {yy-test-web.chinacloudsites.cn}WebSpace : leohahahhahahaha-ChinaNorthwebspaceSelfLink : https://cnws-prod-bjb-005.api.chinacloudsites.chinacloudapi.cn:454/subscriptions/5e58c83f-1967-4f91-8fbd-dea4f66305cd/webspaces/leohahahhahahaha-ChinaNorthwebspace/sites/yy-test-webRepositorySiteName : yy-test-webSku : FreeUsageState : NormalEnabled : TrueAdminEnabled : TrueEnabledHostNames : {yy-test-web.chinacloudsites.cn, yy-test-web.scm.chinacloudsites.cn}SiteProperties : Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities.SitePropertiesAvailabilityState : NormalHostNameSslStates : {yy-test-web.chinacloudsites.cn, yy-test-web.scm.chinacloudsites.cn}AzureDriveTraceEnabled :AzureDriveTraceLevel : ErrorAzureTableTraceEnabled :AzureTableTraceLevel : ErrorAzureBlobTraceEnabled :AzureBlobTraceLevel : ErrorManagedPipelineMode : IntegratedWebSocketsEnabled : FalseRemoteDebuggingEnabled : FalseRemoteDebuggingVersion :RoutingRules : {}Use32BitWorkerProcess : TrueAutoSwapSlotName :SlotStickyAppSettingNames : {}SlotStickyConnectionStringNames : {}
Attention:
Conflict: Cannot complete the operation because the site will exceed the number of slots allowed for the 'Free' SKU.
Basic 和 Free 都没有slot功能,需 Scale Up到 Standard 或 Premium
PS C:\Users\Administrator.USER-20170626GN> $wsQASlot = "QA"PS C:\Users\Administrator.USER-20170626GN> New-AzureWebsite -Location $wsLocation -Name $wsName -Slot $wsQASlotNew-AzureWebsite : **Conflict: Cannot complete the operation because the site will exceed the number of slots allowed for the 'Free' SKU.**At line:1 char:1+ New-AzureWebsite -Location $wsLocation -Name $wsName -Slot $wsQASlot+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : CloseError: (:) [New-AzureWebsite], Exception+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Websites.NewAzureWebsiteCommandPS C:\Users\Administrator.USER-20170626GN> New-AzureWebsite -Location $wsLocation -Name $wsName -Slot $wsQASlotInstances : {}NumberOfWorkers : 1DefaultDocuments : {Default.htm, Default.html, Default.asp, index.htm...}NetFrameworkVersion : v4.0PhpVersion : 5.6RequestTracingEnabled : FalseHttpLoggingEnabled : FalseDetailedErrorLoggingEnabled : FalsePublishingUsername : $yy-test-web__QAPublishingPassword : HxJjbW7qruqffWAk02ah7gcvFmd4TfBP70W61jW60Ff3eZJrlFayajMfGBCXAppSettings : {WEBSITE_NODE_DEFAULT_VERSION}Metadata : {}ConnectionStrings : {}HandlerMappings : {}Name : yy-test-web(QA)State : RunningHostNames : {yy-test-web-qa.chinacloudsites.cn}WebSpace : leohahahhahahaha-ChinaNorthwebspaceSelfLink : https://cnws-prod-bjb-005.api.chinacloudsites.chinacloudapi.cn:454/subscriptions/5e58c83f-1967-4f91-8fbd-dea4f66305cd/webspaces/leohahahhahahaha-ChinaNorthwebspace/sites/yy-test-webRepositorySiteName : yy-test-webSku : StandardUsageState : NormalEnabled : TrueAdminEnabled : TrueEnabledHostNames : {yy-test-web-qa.chinacloudsites.cn, yy-test-web-qa.scm.chinacloudsites.cn}SiteProperties : Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities.SitePropertiesAvailabilityState : NormalHostNameSslStates : {yy-test-web-qa.chinacloudsites.cn, yy-test-web-qa.scm.chinacloudsites.cn}AzureDriveTraceEnabled :AzureDriveTraceLevel : ErrorAzureTableTraceEnabled :AzureTableTraceLevel : ErrorAzureBlobTraceEnabled :AzureBlobTraceLevel : ErrorManagedPipelineMode : IntegratedWebSocketsEnabled : FalseRemoteDebuggingEnabled : FalseRemoteDebuggingVersion : VS2012RoutingRules : {}Use32BitWorkerProcess : TrueAutoSwapSlotName :SlotStickyAppSettingNames :SlotStickyConnectionStringNames :
URL:
http://yy-test-web.chinacloudsites.cn/
http://yy-test-web-qa.chinacloudsites.cn
PS C:\Users\Administrator.USER-20170626GN> $wsProduction="Production"PS C:\Users\Administrator.USER-20170626GN> Switch-AzureWebsiteSlot -Name $wsName -Slot1 $wsQASlot -Slot2 $wsProduction
publish:
将代码复制到slot的过程
tools:
Publish a web deployment package:
$pkgPath="E:\xx.zip"Publish-AzureWebsiteProject -Name $wsName -Slot $wsQASlot -Package $pkgPath
webjob:
在Azure website 运行后台任务的应用或代码
types:
deploy an Azure Webjob:
Name path settings.job : 0 30 9 * * 1-5
{"schedule": "0 */15 * * * *"}
only support Tiggered Type
$wjPath="E:\xx.exe"$wjName="xx-WebJob"New-AzureWebsiteJob -Name $wsName -JobName $wjName Triggered -Slot $wsQASlot -JobFile $wjPath