====== Microsoft Azure ====== Потрясные настоящие ОБЛАКА от Microsoft. Начинаю собирать ссылки * https://wiki.debian.org/Cloud/MicrosoftAzure * https://docs.microsoft.com/ru-ru/azure/cloud-services/ * https://docs.microsoft.com/ru-ru/azure/virtual-machines/ * https://docs.microsoft.com/ru-ru/azure/virtual-machines/linux/ * https://azure.microsoft.com/ru-ru/global-infrastructure/regions/ Что такое временной диск? [[https://azure.microsoft.com/ru-ru/pricing/details/virtual-machines/linux/|Цены на виртуальные машины Linux / FAQ]] Временным диском является хранилище, подключенное непосредственно к развернутой виртуальной машине. После закрытия виртуальной машины данные на временном диске теряются. Если вам требуется постоянное хранилище, существует множество доступных постоянных дисков данных различных типов и размеров, тарифицируемых отдельно. Дополнительные сведения см. в разделе Цены на хранилище. В качестве постоянного хранилища виртуальных машин мы рекомендуем использовать "Управляемые диски", чтобы пользоваться преимуществами улучшенных функций управления, масштабируемости, доступности и безопасности. ==== Где можно развернуть облако ==== * [[https://azure.microsoft.com/ru-ru/global-infrastructure/germany/|Microsoft Azure для Германии]] * [[https://azure.microsoft.com/ru-ru/global-infrastructure/locations/|Расположения Azure]] * [[https://docs.microsoft.com/ru-ru/azure/virtual-machines/windows/regions-and-availability#availability-zones|Регионы и доступность виртуальных машин в Azure]] ==== SQL ==== * [[https://docs.microsoft.com/ru-ru/azure/sql-database/|Документация по Базе данных SQL Azure]] * [[https://docs.microsoft.com/ru-ru/azure/virtual-machines/windows/sql/virtual-machines-windows-sql-automated-backup-v2|Автоматическая архивация версии 2 для виртуальных машин Azure (Resource Manager)]] * [[https://docs.microsoft.com/ru-ru/azure/virtual-machines/windows/sql/virtual-machines-windows-portal-sql-server-provision|Как подготовить виртуальную машину SQL Server на платформе Windows на портале Azure]] * [[https://docs.microsoft.com/en-us/azure/sql-database/sql-database-export|Export an Azure SQL database to a BACPAC file]] * [[https://sqlbackupandftp.com/blog/how-to-backup-azure-sql-database-to-local-machine|How to backup Azure SQL Database to Local Machine]] ==== waagent ==== * [[https://docs.microsoft.com/ru-ru/azure/virtual-machines/extensions/update-linux-agent|Как обновить агент Azure Linux на виртуальной машине]] * [[http://debian-archive.trafficmanager.net/debian/pool/main/w/waagent/|APT репозиторий для Debian]] ==== Диски/бэкапы ==== * [[https://gallery.technet.microsoft.com/scriptcenter/Azure-Identify-and-baaf6a10#content|Azure - Identify and Optionally Delete Orphaned Disks]] * [[https://blogs.technet.microsoft.com/ukplatforms/2018/02/21/azure-cost-optimisation-series-identify-orphaned-disks-using-powershell/|Azure Cost Optimisation Series – Identify Orphaned Disks Using PowerShell]] * [[https://docs.microsoft.com/ru-ru/azure/virtual-machines/windows/about-disks-and-vhds#disks-used-by-vms|Основные сведения о дисковых хранилищах для виртуальных машин Windows в Azure]] * [[https://docs.microsoft.com/ru-ru/azure/backup/backup-azure-vms-first-look-arm|Резервное копирование виртуальных машин Azure в хранилище служб восстановления]] * [[https://www.wintellect.com/using-rclone-with-azure-for-a-low-cost-backup/|Using Rclone with Azure for a Low-cost Backup]] ==== Немного про SLA, Availability Sets и Availability Zones ==== * [[https://blog.siliconvalve.com/2020/11/17/understanding-azure-availability-sets-and-availability-zones/|Understanding Azure Availability Sets and Availability Zones]] * [[https://www.pragimtech.com/blog/azure/azure-regions-and-paired-regions/|Azure Regions | Paired Regions | Availability Zones]] / [[https://www.pragimtech.com/blog/azure/availability-set-vs-availability-zone/|Azure availability set vs availability zone]] * [[https://aidanfinn.com/?p=21495|Azure Availability Zones in the Real World]] * [[https://www.parallels.com/blogs/ras/azure-availability-zones/|Azure Availability Zones: Achieve High Availability]] * [[https://superadmins.com/how-to-achieve-high-availability-on-azure/|How to achieve high availability for your app on Azure]] ==== Создать swap ==== [[https://support.microsoft.com/en-us/help/4010058/how-to-add-a-swap-file-in-linux-azure-virtual-machines|How to add a swap file in Linux Azure virtual machines]] Добавить в файл ''/etc/waagent.conf'' ResourceDisk.Format=y ResourceDisk.EnableSwap=y ResourceDisk.SwapSizeMB=xx xx размер swap файла в MB. Перезапустить WALinuxAgent Ubuntu: service walinuxagent restart Red Hat/Centos: service waagent restart Проверка dmesg | grep swap swapon -s cat /proc/swaps file /mnt/resource/swapfile free | grep -i swap ==== Установка Powershell ==== [[https://docs.microsoft.com/ru-ru/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6#debian-9|Инструкция для Debian 9]] # Install system components sudo apt-get update sudo apt-get install curl apt-transport-https # Import the public repository GPG keys curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - # Register the Microsoft Product feed sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-jessie-prod jessie main" > /etc/apt/sources.list.d/microsoft.list' # Update the list of products sudo apt-get update # Install PowerShell sudo apt-get install -y powershell # Start PowerShell pwsh ==== Почта в Azure ==== 25 порт в Azure закрыт. Почему * [[https://blogs.msdn.microsoft.com/azuresecurity/2016/08/16/pro-tip-on-sending-email-from-azure-virtual-machines-to-external-domains/|On Sending Email From Azure Virtual Machines to External Domains]] * [[https://blogs.msdn.microsoft.com/mast/2017/11/15/enhanced-azure-security-for-sending-emails-november-2017-update/|Enhanced Azure Security for sending Emails – November 2017 Update]] * [[https://www.experts-exchange.com/articles/32747/Azure-SMTP-Restrictions-Resolution-with-SMTP-Relay-Services.html|Azure SMTP Restrictions & Resolution with SMTP Relay Services]] Что делать? **To solve this problem, you’ll need to use an SMTP relay that is *not* hosted in Azure. That SMTP relay can be on-premises or you can use an SMTP hoster. Whatever works best for you.** Используем внешний релей или пишем в саппорт и объясняем почему нам так нужен 25 порт Новый тикет: Support → Technical → Virtual Network → Connectivity → Cannot send e-mail (SMTP/Port 25). ==== Полезные блоги ==== * https://www.garethjones294.com/console-access-to-azure-virtual-machines/ * https://blog.nicolaayan.com/2018/09/azure-horizontal-vs-vertical-scaling/ * https://pachehra.blogspot.com/2019/12/azure-storage-account-lets-understand.html * https://microsoft.github.io/AzureTipsAndTricks/ ==== Дорогая причина избегать группы доступности в Azure ==== http://www.spbdev.biz/blog/dorogaya-prichina-izbegat-gruppy-dostupnosti-v-azure {{:microsoft:azure:azure_expensive.jpg?nolink&550|}} ==== WAF ==== В чем разница между **Front door** и **Application gateway** The first real difference between the Azure Load Balancer and Application Gateway is that an ALB works with traffic at Layer 4, while Application Gateway handles just Layer 7 traffic, and specifically, within that, HTTP (including HTTPS and WebSockets).4 апр. https://blog.siliconvalve.com/2017/04/04/when-to-use-azure-load-balancer-or-application-gateway/ While both Front Door and Application Gateway are layer 7 (HTTP/HTTPS) load balancers, the primary difference is that Front Door is a global service whereas Application Gateway is a regional service. https://docs.microsoft.com/en-us/azure/frontdoor/front-door-faq [[https://www.azure-heros.com/blog/azure-front-door-vs-azure-traffic-manager-vs-azure-application-gateway-vs-azure-load-balancer-vs-content-delivery-network-cdn|Azure Front Door VS Azure Traffic Manager VS Azure Application Gateway VS Azure Load Balancer VS CDN]] [[https://docs.microsoft.com/ru-ru/azure/application-gateway/log-analytics|Use Log Analytics to examine Application Gateway Web Application Firewall (WAF) Logs]] Несколько примеров по настройке * [[https://securecloud.blog/2020/01/02/experimental-testing-azure-ad-application-proxy-with-azure-application-gateway-waf/|Experimental testing: Azure AD Application Proxy With Azure Application Gateway WAF]] * [[https://aidanfinn.com/?p=21566|Understanding How Azure Application Gateway Works]] * [[https://www.2azure.nl/2019/08/13/deploy-azure-application-gateway-with-http-to-https-redirect/|Deploy Azure Application Gateway with http to https redirect]] * https://4sysops.com/archives/azure-application-gateway-and-web-application-firewall-waf/ * [[https://microsoft.github.io/AzureTipsAndTricks/blog/tip254.html|Securing your application with a Web Application Firewall (WAF)]] * [[https://www.itgeekrambling.co.uk/azure-azure-web-application-firewall-configuration-with-ssl-and-multi-site/|Azure – Azure Web Application Firewall – Configuration with SSL and multi-site]] * https://roykim.ca/2018/09/06/penetration-testing-your-web-app-with-azure-application-gateway-waf-part-2-owasp-zap-tool/ * https://gautambiztalkblog.com/2017/02/03/how-to-protect-your-web-site-using-waf-enabled-application-gateway/ * https://gautambiztalkblog.com/2017/02/03/how-to-protect-your-web-site-using-waf-enabled-application-gateway/ * https://sabbour.me/how-to-run-an-app-service-behind-a-waf-enabled-application-gateway/ * [[https://blog.spaelling.xyz/2019/05/monitoring-blocked-requests-in-azure.html|Monitoring Blocked Requests in Azure Web Application Firewall]] Еще ссылки/документация * [[https://docs.microsoft.com/ru-ru/azure/application-gateway/custom-error|Create Application Gateway custom error pages]] ==== Разное ==== * https://www.azurespeed.com/Information/AzureIpRanges ==== Ошибка **kernel: serial8250: too much work for irq4** ==== Не баг, а фича. * https://dba010.com/2019/06/19/kernel-serial8250-too-much-work-for-irq4-potential-problem-caused-by-azure-oms-agent/ * [[https://github.com/amzn/amzn-drivers/issues/84#issuecomment-445522226|интересная мысль]] * [[https://github.com/Azure/WALinuxAgent/issues/1571|waagent is flodding serial port]] Поставить ''Logs.Console=n'' в файле ''/etc/waagent.conf'' service waagent restart service walinuxagent restart systemctl restart waagent ==== Несколько IP адресов для одной VM ==== * [[https://social.msdn.microsoft.com/Forums/sqlserver/ja-JP/491aa64e-9221-44f6-9a43-76051000e18e/unable-to-get-secondary-ip-working-on-azure-vm-centos?forum=WAVirtualMachinesVirtualNetwork|Unable to get Secondary IP working on Azure VM (CentOS) RRS feed]] * [[https://docs.microsoft.com/en-us/azure/virtual-network/ip-services/virtual-network-multiple-ip-addresses-portal|Assign multiple IP addresses to virtual machines using the Azure portal]] Создать в ''cd /etc/sysconfig/network-scripts'' файл ''ifcfg-eth0:0'' DEVICE=eth0:0 BOOTPROTO=static ONBOOT=yes IPADDR=10.0.0.50 NETMASK=255.255.255.0 Чтобы заработали виртуальные хосты в Apache, как оказалось нужно указывать внутренний IP. Плюс также внутренние IP в '''' {{:microsoft:azure:azure_multiple_ip_vm.png?nolink|}} У меня не заработало пока не выставил оба адреса в Static вместо Dynamic. ==== Можно ли поменять имя VM в Azure Portal? ==== Нет. https://stackoverflow.com/questions/49756148/change-azure-virtual-machine-name-in-azure-portal ==== Можно ли перенести IP адрес с одной ВМ на другую? ==== [[https://docs.microsoft.com/en-us/answers/questions/227064/is-it-possible-to-transfer-the-public-ip-address-f.html|Is it possible to transfer the public IP address from one VM to another?]] Перенести можно. Остановить VM. Сделать detach, сделать attach.