Edi Wang

Microsoft MVP for Azure

PowerShell

PowerShell Script to Check Azure App Service SSL Certificate Expiration

When you have a lot of App Service instances running in your Azure subscription, managing their SSL certificate status could be a problem. Azure portal itself does have certain monitoring and advising feature to visualize the certificate status and warn you before a certificate expires. However, in some cases, we prefer this to be done in command line environment. That's why I put together this handy PowerShell script that uses Azure CLI to keep tabs on all your App Service SSL certificates.
Azure PowerShell App Service CLI

Automating Price Calculation from File Names Using PowerShell

Manually extracting and summing prices embedded in file names for a large number of files is time-consuming and is easy to make errors. This blog post introduces a PowerShell script designed to automate this process efficiently. The script scans a specified directory, identifies file names containing prices using a regex pattern, extracts these values, and calculates their total, making it an ideal solution for tasks like invoice management.
PowerShell

How to Get Azure App Service Windows Worker OS Full Name and Version

Sometimes, it's crucial to know the underlying operating system running your Azure App Service. This can help you address compatibility issues during development before deploying to Azure. Unfortunately, Microsoft's documentation does not specify the exact operating system name and version of the Web Worker that runs your application. So, it's up to us to determine this information.
Azure PowerShell App Service

Scripts for Recursively Download All Files from a Public Azure Storage Container

In my previous blog post, "How to List All Files in a Public Azure Storage Container", I demonstrated how to use the Azure REST API to retrieve a comprehensive list of all file information in a public Azure Storage container without requiring any keys or authentication. Leveraging this method, you can easily create scripts to download all files from a public Azure Storage container without the need to install any additional tools. In this post, I will share PowerShell and Python scripts to do that.
Azure PowerShell Python Azure Blob Storage

PowerShell to Enable SQL Server Express Remote Access

SQL Server Express is a free edition of Microsoft's SQL Server, which is a relational database management system (RDBMS). However, remote access is not enabled by default on this SKU. To access a SQL Server Express instance from the network, we have to do a few steps. There's plenty of guide on the internet telling you how to enable remote access via GUI, but I would like to do it from PowerShell. …
SQL Server PowerShell

Use Azure Function to Schedule Auto Start for VMs

VMs on the Microsoft Azure platform can be configured to automatically shut down by schedule. However, currently only VMs in the DevTest Lab service can be powered on automatically. Regular VMs have not been updated with the auto start capability. But still, we can take advantage of Azure Function V3 and PowerShell Core to start the VM by timed schedule. The Idea I have wrote a post 6 year ago …
Azure PowerShell VM Azure Function

Incremental Build Number for .NET Core via Azure DevOps

People familiar with the. NET framework knows that we can let the compiler self-increase the version number by specifying AssemblyVersion as 10.0.*. But. NET core and. NET Standard are not. Even with open-source projects like MSBump, there are certain flaws. Typically, such a requirement happens on a CI/CD server. Let's take a look at how to easily handle it with Azure DevOps. About Versioning in …
.NET PowerShell Azure DevOps

Automate Windows 10 Developer Machine Setup

One of the things programmers hate most is probably setup a computer. Because the programmer's computer environment configuration is very different from normal people. In general, it takes several hours to manually install a new development machine. Let this process automating, after all, the essence of programming is to let complex things simplify, find a way to be lazy! In fact, automatic …
Windows PowerShell Choco

如何定时开关机Microsoft Azure上的虚拟机

作为一个屌丝,用Azure的时候得处处想着省钱,在你不用虚拟机的时候关机是个省钱的好办法。当然,每天手动登录Portal去开关机比较麻烦。如果你用VM的时间段比较固定,可以做个定时开关机的任务帮你省钱。 做法是用一台机器作为Controller,在上面建立开关机任务,调度Azure上的VM。比如你自己的机器每天早上8点开机,下午5点关机。你希望Azure上的某台VM早上8:30开机,下午4:30关机。那你就可以把自己的机器作为Controller。当然,你也可以在Azure上开一台专门作为Controller的Server,给它分配一个768MB内存的屌丝instance(diaostance)来省钱。 这台Controller机器上必须安装Microsoft Azure PowerShell,并且要在PowerShell里登录一次Azure。本文不再叙述,具体做法请看我之前写的《图解 …
Azure PowerShell VM

图解:使用Azure PowerShell创建和删除虚拟机

昨天教了大家如何使用Windows Azure PowerShell启动和关闭虚拟机,但光会用PS开关机还是不够的。如果你还在用网页版Portal创建和删除虚拟机,而只用PS去开关机,逼格明显就不完整了。所以今天再教大家如何用Windows Azure PowerShell创建和删除虚拟机,完成整个装逼过程。 首先,使用Windows Azure PowerShell登录Azure账户的步骤不再重复了,上一篇文章里有。假定你已经登录了。 如果你想查看虚拟机列表命令是: Get-AzureVM 1. 要创建虚拟机需要获得一些前置信息。第一个是你的订阅名称。运行这条命令获得: Get-AzureSubscription 在我的例子中,结果是Windows Azure MSDN - Visual Studio Ultimate。这是一个一年价值12w的订阅,大家不要在意这些细 …
Azure PowerShell VM