azure

How to know the size of an Azure blob object via Python Azure SDK

心不动则不痛 提交于 2021-02-08 07:33:29
问题 Following the Microsoft Azure documentation for Python developers. The azure.storage.blob.models.Blob class does have a private method called __sizeof__() . But it returns a constant value of 16, whether the blob is empty (0 byte) or 1 GB. Is there any method/attribute of a blob object with which I can dynamically check the size of the object? To be clearer, this is how my source code looks like. for i in blobService.list_blobs(container_name=container, prefix=path): if i.name.endswith('.json

Running Playwright in Azure Function

廉价感情. 提交于 2021-02-08 07:26:12
问题 I'm trying to run a simple Azure Function that would enter page and generate a PDF depending on what is visible in a browser. I created a NodeJS 12 Azure Function with Linux Consumption Plan (B1). I set PLAYWRIGHT_BROWSERS_PATH to 0 . Function code looks like this: const { chromium } = require("playwright-chromium"); const baseUrl = "http://someurl"; const targetPage = "/action/"; module.exports = async function (context, req) { const browser = await chromium.launch(); const page = await

Schedule Azure VM to turn on, run a script and turn off

白昼怎懂夜的黑 提交于 2021-02-08 07:23:49
问题 I have a multi-container app that I need to run twice a day at specific times for about 30 mins each time. To save costs, I would like to: Turn on a Linux VM on Microsoft Azure Run a script that runs docker-compose up -d , waits 30 mins, then calls docker-compose stop Turn off the VM I'd love for this to happen automatically on a cron schedule. So far, I've failed to find any Azure solution that can do all of this. Azure automation allows you to turn on/off VMs but it doesn't allow you to run

Running Playwright in Azure Function

Deadly 提交于 2021-02-08 07:23:25
问题 I'm trying to run a simple Azure Function that would enter page and generate a PDF depending on what is visible in a browser. I created a NodeJS 12 Azure Function with Linux Consumption Plan (B1). I set PLAYWRIGHT_BROWSERS_PATH to 0 . Function code looks like this: const { chromium } = require("playwright-chromium"); const baseUrl = "http://someurl"; const targetPage = "/action/"; module.exports = async function (context, req) { const browser = await chromium.launch(); const page = await

How to use Microsoft Graph API with Certificates (INTUNE)

大城市里の小女人 提交于 2021-02-08 06:33:51
问题 C# code to access MS GRAPH API (IN THIS CASE INTUNE) and use certificates for authentication. This is based on article to be found here: https://laurakokkarinen.com/authenticating-to-office-365-apis-with-a-certificate-step-by-step/comment-page-2/#comment-697 The first is a powershell script to generate certificate. Then there is a logger interface and configurator to read from JSON file. Thereupon there is a READER using asynchronous calls to authenticate with API and get in return a token. #

Enable Sql Dependency in Application Insights on Azure Functions with EF Core

此生再无相见时 提交于 2021-02-08 06:25:15
问题 I have an Azure Function v3 application which uses Microsoft.EntityFrameworkCore 3.1.5 . I am not able to enable SQL Dependency tracking. Struggling with it 1 day already. To isolate the issue, I have created a standalone AzureFunction without EF. Instead of EF I was using Microsoft.Data.SqlClient 1.0.19269.1 which is also used by EF. Here goes the function: public static class Function1 { [FunctionName("Function1")] public static async Task<IActionResult> Run( [HttpTrigger(AuthorizationLevel

How to run a docker container in Azure pipeline?

老子叫甜甜 提交于 2021-02-08 06:15:31
问题 Azure documentation (https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/docker?view=azure-devops) does not specify how to run a docker container in Azure pipeline. We can use the Docker@2 task to build / push docker images but it does not have a command to run a container. By looking at source code of older versions of Docker task I can see there has been a run command, but those are now deprecated and there is no documentation to be found. I also followed the doc: https:/

Azure Media Services (v3) - specific output asset container name

血红的双手。 提交于 2021-02-08 06:10:52
问题 I have a program similar to AMSV3Quickstarts example and I need to change the default name for container for the output asset in accordance with my program logic/contract. Is it possible to change the output asset container name somehow? What I tried: RTFM Change the transform job name Change the locator name Change the output asset name However, in my blob storage, it is still in asset-{GUID} format. 回答1: When using the REST API for Create Asset you are able to set the container name: https:

Sysprep an Azure VM using PowerShell task in a pipeline

岁酱吖の 提交于 2021-02-08 05:50:50
问题 My (dotNET) application is built (using a Windows Hosted agent), from a build pipeline, and in the subsequent Release pipeline, I provision a 16GB-Win2016 VM (enabling RDP, HTTP, HTTPS, WinRM and SSH), into which I RDP manually (there is a Manual Intervention task here), and configure WinRM (following this article: https://docs.microsoft.com/en-us/azure/marketplace/cloud-partner-portal/virtual-machine/cpp-configure-winrm-after-vm-creation#configure-vm-to-enable-winrm). Everything is fine

Protect Azure Pipeline Yaml File from Being Edited

人走茶凉 提交于 2021-02-08 05:36:26
问题 Currently storing our pipeline YAML files in our git repo in Azure Devops - trying to find a way to restrict certain users from editting/accessing the YAML file or even possibly a folder that contains the YAML file. We want to implement additional security to prevent our developers from modifying our YAML files to potential exploit sensitive information or make changes that we don't approve (We have a PR policy in place, but would like additional security measures). Ideally - we could setup a