Microsoft 为部署在可用性中的多实例 VM 提供 99.95% 的外部连接性服务级别协议 (SLA)。 这意味着,对于要应用的 SLA,必须在可用性集中至少部署两个 VM 实例。
You plan to deploy three Azure virtual machines named VM1, VM2, and VM3. The virtual machines will host a web app named App1. You need to ensure that at least two virtual machines are available if a single Azure datacenter becomes unavailable. What should you deploy? A. all three virtual machines in a single Availability Zone B. all virtual machines in a single Availability Set C. each virtual machine in a separate Availability Zone D. each virtual machine in a separate Availability Set
Answer is B.
可以自己提供非官方镜像用于创建虚拟机
It is possible to change the size of a VM after it’s been created, but the VM must be stopped first. So, it’s best to size it appropriately from the start if possible.调整vm配置需要停机
The rules are evaluated in priority-order, starting with the lowest priority rule. Deny rules always stop the evaluation. The last rule is always a Deny All rule.That means to have traffic pass through the security group you must have an allow rule or it will be blocked by the default final rule. 规则使用优先级层叠,若无允许则被底层规则(the final rule)禁止
param([string]$resourceGroup) // 获取变量参数 $adminCredential = Get-Credential -Message "Enter a username and password for the VM administrator." For ($i = 1; $i -le 3; $i++) { $vmName = "ConferenceDemo" + $i Write-Host "Creating VM: " $vmName New-AzVm -ResourceGroupName $resourceGroup -Name $vmName -Credential $adminCredential -Image UbuntuLTS }
Q: Admin1 attempts to deploy an Azure Marketplace resource by using an Azure Resource Manager template. Admin1 deploys the template by using Azure PowerShell and receives the following error message: “User failed validation to purchase resources. Error message: “Legal terms have not been accepted for this item on this subscription. To accept legal terms, please go to the Azure portal (http:// go.microsoft.com/fwlink/?LinkId=534873) and configure programmatic deployment for the Marketplace item or create it there for the first time.” You need to ensure that Admin1 can deploy the Marketplace resource successfully. What should you do? Answer is: From Azure PowerShell, run the Set-AzMarketplaceTerms cmdlet
数据和存储
数据:结构化数据、半结构化数据(也就是NoSQL数据,如Json数据,Xml数据)、非结构化数据 事务数据库:联机事务处理(Online Transaction Processing,OLTP)系统和联机分析处理(Online Analytical Processing,OLAP)系统,通常情况下,前者服务于较大量的用户,响应更快,可用性更高,处理大量数据(handle large volumns of data),后者用于处理大型复杂事务(handle large and complex transactions) 建议使用Azure Cosmos DB管理NoSQL数据,使用Azue Blob Storage管理文件数据,结构化数据使用Azure SQL Database, Azure SQL Database可以认为是云端托管的sqlserver
订阅
AZ104 Q9 Only a global administrator can add users to this tenant. 跨订阅移动资源,虚拟机、存储、虚拟网络、托管磁盘(managed disk)、Recovery Service均可移动 Microsoft Docs:跨订阅移动方案
You have a Microsoft 365 tenant and an Azure Active Directory (Azure AD) tenant named contoso.com. You plan to grant three users named User1, User2, and User3 access to a temporary Microsoft SharePoint document library named Library1. You need to create groups for the users. The solution must ensure that the groups are deleted automatically after 180 days. Which two groups should you create? Each correct answer presents a complete solution. A. an Office 365 group that uses the Assigned membership type B. a Security group that uses the Assigned membership type C. an Office 365 group that uses the Dynamic User membership type D. a Security group that uses the Dynamic User membership type E. a Security group that uses the Dynamic Device membership type
JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object.
public class HomeController : Controller { private IMemoryCache _cache;
public HomeController(IMemoryCache memoryCache) { _cache = memoryCache; }
CacheKeys API
1 2 3 4 5 6 7 8 9 10 11 12 13
public static class CacheKeys { public static string Entry { get { return "_Entry"; } } public static string CallbackEntry { get { return "_Callback"; } } public static string CallbackMessage { get { return "_CallbackMessage"; } } public static string Parent { get { return "_Parent"; } } public static string Child { get { return "_Child"; } } public static string DependentMessage { get { return "_DependentMessage"; } } public static string DependentCTS { get { return "_DependentCTS"; } } public static string Ticks { get { return "_Ticks"; } } public static string CancelMsg { get { return "_CancelMsg"; } } public static string CancelTokenSource { get { return "_CancelTokenSource"; } } }
缓存一个时间
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
DateTime cacheTiming;
// Look for cache key. if (!_cache.TryGetValue(CacheKeys.Entry, out cacheEntry)) { cacheEntry = DateTime.Now;
// Set cache options. var cacheEntryOptions = new MemoryCacheEntryOptions() // Keep in cache for this time, reset time if accessed. .SetSlidingExpiration(TimeSpan.FromSeconds(3));
// Save data in cache. _cache.Set(CacheKeys.Entry, cacheTiming, cacheEntryOptions); }
取出缓存
1
var timing = _cache.Get<DateTime?>(CacheKeys.Entry);
使用extern “C” {}用以避免“Name Mangling”处理:由于在这个特殊的结构中,C++ 编译器会强制以 C 语言的语法规则,来编译放置在这个作用域内的所有 C++ 源代码。而在 C 语言的规范中,没有“函数重载”这类特性,因此也不会对函数名进行 “Name Mangling” 的处理。