An Azure platform as a service offer that is used to deploy web and cloud applications.
Hello @Jon Elster ,
it sounds like every time your Cloud Service role gets recycled or reimaged, any certificates or files you manually install on the VM are lost because the OS disk is ephemeral. Here’s what you can do to keep your SSL certs and any files you need across restarts:
Persisting SSL certificates • Upload your certificate to Azure Key Vault (or directly into the Cloud Service certificate blade) • In your ServiceDefinition.csdef, add a <Certificates> element under your <Role> pointing to that cert name/thumbprint. • In your ServiceConfiguration.cscfg, reference the same cert name and key-vault settings. • At startup the PaaS agent will automatically pull the cert into the IIS store for you on each VM restart. See "Use certificates with Azure Cloud Services (extended support)" and "Store and use certificates in Azure Cloud Services (extended support)" for step-by-step instructions.
Persisting files across restarts • Azure Cloud Service VMs only guarantee that files in your packaged app and any LocalResource you define will survive a simple role recycle. Even then, “local” storage is wiped on OS upgrades or reimages. • For truly durable storage, use Azure Storage – e.g. – Blob storage or Data Lake for unstructured data – Azure Files (SMB share) if you need a mapped drive • If you still need a local temp folder between recycles (but know it won’t survive reimages), you can define a <LocalResources> entry in ServiceDefinition.csdef with removeOnRoleRecycle="false".
Let me know if you need code samples for the ServiceDefinition/ServiceConfiguration changes or help mounting an Azure File share.
Reference docs
- Use certificates with Azure Cloud Services (extended support): https://docs.microsoft.com/azure/cloud-services-extended-support/certificates-and-key-vault
- Store and use certificates in Azure Cloud Services (extended support): https://docs.microsoft.com/azure/cloud-services-extended-support/certificates-and-key-vault
- Config files and packaging for Cloud Services (extended support): https://docs.microsoft.com/azure/cloud-services-extended-support/cloud-services-model-and-package
- Frequently asked questions for Cloud Services (extended support): https://docs.microsoft.com/azure/cloud-services-extended-support/faq
- Azure Storage overview (Blob/File): https://docs.microsoft.com/azure/storage/fundamentals-overview
Was this helpful?